package com.niiwoo.civet.trade.enums;

import com.niiwoo.civet.base.enums.RefundTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 还款、代还、垫付寻找还款计划和回款计划方式
 */
@Getter
@AllArgsConstructor
public enum RefundOptTypeEnum {

    OVERDEPT(Byte.valueOf("1"), "提前结清"),
    BY_PROJECT_STATS(Byte.valueOf("2"), "依赖项目状态"),
    BY_COMPARE_DATE(Byte.valueOf("3"), "依赖比较日期"),
    BY_SPECIFIED_AMOUNT(Byte.valueOf("4"), "指定金额"),
    BY_SPECIFIED_PERIODS(Byte.valueOf("5"), "指定期数");

    private final Byte optType;

    private final String desc;

    /**
     * 还款方式会影响该返回结果
     * @param refundOptTypeEnum
     * @param refundTypeEnum
     * @return
     */
    public static RefundOptTypeEnum getRealRefundOptTypeEnum(RefundOptTypeEnum refundOptTypeEnum, RefundTypeEnum refundTypeEnum){
        if(RefundTypeEnum.OVERDEPT.equals(refundTypeEnum)){
            return RefundOptTypeEnum.OVERDEPT;
        }
        return refundOptTypeEnum;
    }
}
